package com.ch.control;


import com.ch.Result;
import com.ch.dao.OrderDao;
import com.ch.entity.Order;
import com.ch.entity.User;
import com.ch.entity.appproprity;
import com.ch.service.OrderService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("order")
public class TestControl {
    @Autowired
    private appproprity appproprity;
    @Autowired
    private OrderService orderService;
    private static Logger log=Logger.getLogger(TestControl.class);
    @GetMapping("test")
    public Result test(){
        log.info("order 已经记录日志");
        log.info(appproprity.getQueuename());
        log.info(appproprity.getWxid());
        log.info(appproprity.getSecrete());
        Order order=new Order("aaassss",222);
        User user=new User("aakkk","123123",2);
        order.setUser(user);
        log.info(order);
        orderService.save(order);
        List<String> ignore = appproprity.getIgnore();
        for (String i : ignore) {
            System.out.println(i);
        }
        return Result.success("order");
    }
}
